<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

	<head>
		<title>TooDoo</title>

		<!--<link rel="stylesheet" href="js/dojotoolkit/dijit/themes/soria/soria.css" />-->
		<!--<link rel="stylesheet" href="main.css" />-->
        <!--<SCRIPT TYPE="text/javascript" SRC="http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/dojo.xd.js" djConfig="parseOnLoad:true, isDebug:true, debugContainerId: 'debugContainer'"></SCRIPT>-->

		<script type="text/javascript" src="js/dojotoolkit/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug:true, debugContainerId: 'debugContainer'"></script>


		<style type="text/css">
			@import "http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/resources/dojo.css";
			@import "http://ajax.googleapis.com/ajax/libs/dojo/1.3/dijit/themes/nihilo/nihilo.css"
		</style>
		
		<script type="text/javascript">
			// *** Dojo Requires
			dojo.require("dojo.parser");
			dojo.require("dojo.data.ItemFileWriteStore");
			dojo.require("dijit.Tree");
			
			var store;

			// *** Dojo Init
			dojo.addOnLoad( function() {
				console.log("** Dojo initializing");
				
				/*
				var store = new dojo.data.ItemFileWriteStore({ url: "countries.json" });			
				var treeModel = new dijit.tree.ForestStoreModel({
					store: store,
					query: {"type" : "continent"},
					rootId: "earth",
					rootLabel: "Earth",
					childrenAttrs: ["children"]
				});
				*/

				
				store = new dojo.data.ItemFileWriteStore({ url: "getFS2.php" });

				console.log( "Item store declared.." );

				var treeModel = new dijit.tree.TreeStoreModel({
					store: store,
					query: {"type" : "folder"},
					rootId: "root",
					rootLabel: "Root",
					//onNewItem: function( item, parentInfo ) { console.dir(item); console.dir(parentInfo); }
					childrenAttrs: ["children"]
				});

				console.log( "Tree model declared.." );
				

				var myTree = new dijit.Tree({
					model: treeModel
				}, "myTree");

				console.log( "Tree widget initialized.." );
			});

		</script>

	</head>

	<body class="nihilo" role="application">
z
		<div id="myTree"></div>

		<div id="debugContainer" style="width: 60%; margin: 10px auto;"></div>

	</body>

</html>
		
